import request from '@/utils/request'

// 查询次生灾害隐患评估列表
export function listSecond(id) {
  return request({
    url: '/fxfzaqbz/data/getAllSecondDisasters?id='+id,
    method: 'get',
  })
}

// 查询次生灾害隐患评估详细
export function getSecond(id) {
  return request({
    url: '/fxfzaqbz/data/getSecondDisastersById?id=' + id,
    method: 'get'
  })
}

// 上传次生灾害隐患评估
export function uploadSecond(data) {
  return request({
    url: '/fxfzaqbz/data/saveSecondDisasters',
    method: 'post',
    data: data
  })
}

// 修改次生灾害隐患评估
export function updateSecond(data) {
  return request({
    url: '/fxfzaqbz/data/updateSecondDisasters',
    method: 'post',
    data: data
  })
}

// 删除次生灾害隐患评估
export function delSecond(id) {
  return request({
    url: '/fxfzaqbz/data/deleteSecondDisasters?id=' + id,
    method: 'post'
  })
}

// 生成按月统计
export function createMonFile(id) {
  return request({
    url: '/fxfzaqbz/data/getExcelByMouth?id=' + id,
    method: 'get',
  })
}

// 生成按区域统计
export function createAreaFile(id) {
  return request({
    url: '/fxfzaqbz/data/getExcelByArea?id=' + id,
    method: 'get',
  })
}

// 模板下载
export function downTemplate(name) {
  return request({
    url: '/fxfzaqbz/data/download?fileName='+name,
    method: 'get',
  })
}